#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class SlideShow
	 {
	 #region Member Variables

	 private Int32 _slideShowID;

	 private DateTime _addedDate;

	 private Int32 _bosuutapID;

	 private String _title;

	 private String _imageUrl;

	 private String _description;

	 private Boolean _isActive;

	 private Int32 _displayOrder;

	 #endregion



	 #region Public Properties

	 public Int32 SlideShowID
	 {
		 get { return _slideShowID; }
		 set { _slideShowID = value; }
	 }

	 public DateTime AddedDate
	 {
		 get { return _addedDate; }
		 set { _addedDate = value; }
	 }

	 public Int32 BosuutapID
	 {
		 get { return _bosuutapID; }
		 set { _bosuutapID = value; }
	 }

	 public String Title
	 {
		 get { return _title; }
		 set { _title = value; }
	 }

	 public String ImageUrl
	 {
		 get { return _imageUrl; }
		 set { _imageUrl = value; }
	 }

	 public String Description
	 {
		 get { return _description; }
		 set { _description = value; }
	 }

	 public Boolean IsActive
	 {
		 get { return _isActive; }
		 set { _isActive = value; }
	 }

	 public Int32 DisplayOrder
	 {
		 get { return _displayOrder; }
		 set { _displayOrder = value; }
	 }

	 #endregion

	 #region public static Methods
	 public static int Insert(SlideShow obj)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.Insert(obj);
	 }

	 public static bool Update(SlideShow obj)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.Update(obj);
	 }

	 public static bool Delete(Int32 SlideShowID)
	 {
         try
         {
             SlideShow obj = SlideShow.GetSlideShowByID(SlideShowID);
             webapp4U.FileProcess.DeleteFile(Globals.PhysicalApplicationPath() + "/UserUpload/Bosuutap/" + obj.ImageUrl);
             SlideShowDAL db = new SlideShowDAL();
             return db.Delete(SlideShowID);
         }
         catch { return false; }
	 }

	 public static SlideShow GetSlideShowByID(Int32 SlideShowID)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetSlideShowByID(SlideShowID);
	 }

	 //Get All SlideShow
	 public static List<SlideShow> GetAllSlideShow()
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetAllSlideShow(1, 10000);
	 }

	 //Get All SlideShow
	 public static List<SlideShow> GetAllSlideShow(int PageIndex, int PageSize)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetAllSlideShow(PageIndex, PageSize);
	 }

	 // Get Count All records of Table  SlideShow
	 public static int GetCountSlideShow()
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetCountSlideShow();
	 }

	 // Get SlideShowByBosuutapID
	 public static List<SlideShow> GetSlideShowByBosuutapID(Int32 BosuutapID,int PageIndex, int PageSize)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetSlideShowByBosuutapID(BosuutapID, PageIndex, PageSize);
	 }

	 // Get SlideShowCountByBosuutapID
	 public static int GetSlideShowCountByBosuutapID(Int32 BosuutapID)
	 {
		 SlideShowDAL db = new SlideShowDAL();
		 return db.GetSlideShowCountByBosuutapID(BosuutapID);
	 }

	 #endregion
	 }
}
